package main.java.study.step01;

/**
 * @author liuwenxiu
 * @Description: 运算符
 * @date 2022-7-11 14:03
 */
public class Operator {
    public static void main(String[] args) {
        int a = 10;
        int b = 3;
        System.out.println(a/b);
        
        double c = 12;
        System.out.println(a/c);
        
        
        int e = 10;
        float f = 3.0f;
        double g = 3.0;
        System.out.println(e/f);
        System.out.println(e/g);
        
        



        System.out.println(10.0 / 0.0); // Infinity
        System.out.println(0.0 / 0.0);  //NaN
        System.out.println(10 / 0.0);   //Infinity
//        System.out.println(0 / 0);
//        System.out.println(10 / 0);     //Exception in thread "main" java.lang.ArithmeticException: / by zero at main.java.study.step01.Operator.main(Operator.java:32)


        System.out.println(10%3);   //1
        System.out.println(10%-3);  //1
        System.out.println(-10%3);   //-1
        
        
        short j = 20;
        short k = 40;
        short l = (short) (j + k);
        k += j;
        System.out.println(k);
        
    }
}
